package com.transfer.http.download.taskInterface;

import java.io.File;
import java.net.URL;

import com.transfer.conf.FileTransferConfiguration;

public abstract class FileDownloadTask {
  public long taskId;
  public String MD5;
  public String urlStr = null;// 文件下载的下载地址URL的字符串
  public URL downloadURL = null;// 文件下载的下载地址
  public String fileStorageDir = null;// 文件下载任务指定的文件存储目录
  public String fileName;// 文件下载任务的文件名称
  public long fileLength;// 文件下载任务的文件长度

  public boolean statusError = false;// 文件下载任务的状态
  public long sleepSeconds;// 文件下载任务发生失败时，睡眠的时间
  
  public FileDownloadTask(long taskId, String urlStr, String fileStorageDir,String MD5) {
    this.taskId = taskId;
    this.urlStr = urlStr;
    this.fileStorageDir = fileStorageDir+File.separator+this.taskId+File.separator;
    this.MD5=MD5;
    this.sleepSeconds=FileTransferConfiguration.sleepSeconds;
  }

  public long getTaskId() {
    return taskId;
  }

  public void setTaskId(long taskId) {
    this.taskId = taskId;
  }

  public String getMD5() {
    return MD5;
  }

  public void setMD5(String mD5) {
    MD5 = mD5;
  }

  public String getUrlStr() {
    return urlStr;
  }

  public void setUrlStr(String urlStr) {
    this.urlStr = urlStr;
  }

  public URL getDownloadURL() {
    return downloadURL;
  }

  public void setDownloadURL(URL downloadURL) {
    this.downloadURL = downloadURL;
  }

  public String getFileStorageDir() {
    return fileStorageDir;
  }

  public void setFileStorageDir(String fileStorageDir) {
    this.fileStorageDir = fileStorageDir;
  }

  public String getFileName() {
    return fileName;
  }

  public void setFileName(String fileName) {
    this.fileName = fileName;
  }

  public long getFileLength() {
    return fileLength;
  }

  public void setFileLength(long fileLength) {
    this.fileLength = fileLength;
  }

  public boolean isStatusError() {
    return statusError;
  }

  public void setStatusError(boolean statusError) {
    this.statusError = statusError;
  }

  public long getSleepSeconds() {
    return sleepSeconds;
  }

  public void setSleepSeconds(long sleepSeconds) {
    this.sleepSeconds = sleepSeconds;
  }
}
